#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <stdlib.h>

typedef int SLDataType;

typedef struct ListNode
{
    SLDataType m_nkey;
    struct ListNode* m_pNext;
}ListNode;

ListNode* BuySLcapicity(SLDataType x)
{
    ListNode* newnode = (ListNode*)malloc(sizeof(ListNode));
    if (newnode == NULL)
    {
        perror("malloc fail");
    }
    newnode->m_pNext = NULL;
    newnode->m_nkey = x;
    return newnode;
}

void SLPushBack(ListNode** p, SLDataType x)
{
    ListNode* newnode = BuySLcapicity(x);
    if (*p == NULL)
    {
        *p = newnode;
    }
    else
    {
        ListNode* end = *p;
        while (end->m_pNext)
        {
            end = end->m_pNext;
        }
        end->m_pNext = newnode;
    }
}

void SLPrint(ListNode* p, int k)
{
    ListNode* start = p;
    ListNode* end = p;
    while (--k)
    {
        end = end->m_pNext;
    }
    while (end->m_pNext != NULL)
    {
        end = end->m_pNext;
        start = start->m_pNext;
    }
    printf("%d\n", start->m_nkey);
}

void SLDestory(ListNode** p)
{
    free(*p);
    *p = NULL;
}
int main()
{
    ListNode* plist = NULL;
    int n = 0;
    while (~scanf("%d", &n))
    {
        int number = 0;
        while (n)
        {
            scanf("%d", &number);
            SLPushBack(&plist, number);
            n--;
        }

        int k = 0;
        scanf("%d", &k);
        SLPrint(plist, k);
        SLDestory(&plist);
    }
    

    return 0;
}

